<template>
  <div class="page-warp-view f">
    <vm-common-header
      :pageTitle="pageTitle"
      :goBack="goBack"></vm-common-header>
    <div class="vm-statistice-container">
      <tab
        bar-active-color="#d9271b"
        active-color="#d9271a">
        <tab-item selected @on-item-click="onItemClick">
          <i class="saa-icon saa-cg"></i>
          <em>采购分析</em>
        </tab-item>
        <tab-item class="saa-icon saa-xy" @on-item-click="onItemClick">
          <i class="saa-icon saa-xy"></i>
          <em>询源分析</em>
        </tab-item>
        <tab-item class="saa-icon saa-crk" @on-item-click="onItemClick">
          <i class="saa-icon saa-crk"></i>
          <em>出入库分析</em>
        </tab-item>
      </tab>

      <!-- 采购分析组件 -->
      <vm-statistics-procurement_analysis v-if="Index == 0"></vm-statistics-procurement_analysis>
      <!-- 寻源分析组件 -->
      <vm-statistics-source_analysis  v-if="Index == 1"></vm-statistics-source_analysis>
      <!-- 出入库分析 -->
      <vm-statistics-out_of_storage v-if="Index == 2"></vm-statistics-out_of_storage>
    </div>
    <vm-common-footer></vm-common-footer>
  </div>
</template>

<script>
  import vmCommonHeader from '@/components/vm-common-header' // header 组件
  import vmCommonFooter from '@/components/vm-common-footer' // footer 组件
  import {Tab, TabItem} from 'vux'
  // 采购分析组件
  import procurement_analysis from '@/page/statistics_analysis/procurement_analysis.vue'
  // 寻源分析组件
  import source_analysis from '@/page/statistics_analysis/source_analysis.vue'
  // 出入库组件
  import out_of_storage from '@/page/statistics_analysis/out_of_storage.vue'
  export default {
    data() {
      return {
        pageTitle: this.$route.meta.pageTitle,
        goBack: this.$route.meta.goBack,
        Index: 0
      }
    },
    methods: {
      onItemClick (index) {
        this.Index = index;
      }
    },
    components: {
      'vm-common-header': vmCommonHeader,
      'vm-common-footer': vmCommonFooter,
      'vm-statistics-procurement_analysis': procurement_analysis,
      'vm-statistics-source_analysis': source_analysis,
      'vm-statistics-out_of_storage': out_of_storage,
      Tab,
      TabItem
    }
  }
</script>

<style lang="scss">
.vm-statistice-container {
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  overflow: scroll;
}
.saa-icon {
  background-image: url("../../static/images/saa_Spirit.png") !important;
  background-size: 300px 336px;
  display: inline-block;
  margin-right: 0.066666rem;
}
.vux-tab-wrap {
  padding: 0 !important;
  height: 80px !important;
  .vux-tab-container {
    z-index: 999;
    height: 80px !important;
    border-bottom: 1px solid #eeeeee; /* no */
    .vux-tab {
      height: 80px;
      .vux-tab-item {
        display: flex;
        justify-content: center;
        align-items: center;
        &.vux-tab-selected {
          .saa-cg {
            background-position: -0.493333rem 0;
          }
          .saa-xy {
            background-position: -1rem 0;
          }
          .saa-crk {
            background-position: -1.44rem 0;
          }

        }
        .saa-cg {
          background-position: -36px -36px;
          width: 36px;
          height: 36px;
        }
        .saa-xy {
          background-position: -1rem -0.52rem;
          width: 0.426666rem;
          height: 0.456666rem;
        }
        .saa-crk {
          background-position: -1.44rem -0.51rem;
          width: 0.493333rem;
          height: 0.453333rem;
        }
        em {
          font-size: 26px;
        }
      }
    }
  }
}


</style>


